package com.tancire.net.service.impl;

import java.util.List;
import javax.annotation.Resource;

import cn.hutool.core.util.IdUtil;
import com.tancire.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.tancire.net.mapper.NetUserPersonnelMapper;
import com.tancire.net.domain.NetUserPersonnel;
import com.tancire.net.service.INetUserPersonnelService;

/**
 * 会员认证Service业务层处理
 *
 * @author tancire
 * @date 2024-03-09
 */
@Service
public class NetUserPersonnelServiceImpl implements INetUserPersonnelService {
    @Resource
    private NetUserPersonnelMapper netUserPersonnelMapper;

    /**
     * 查询会员认证
     *
     * @param id 会员认证主键
     * @return 会员认证
     */
    @Override
    public NetUserPersonnel selectNetUserPersonnelById(Long id) {
        return netUserPersonnelMapper.selectNetUserPersonnelById(id);
    }

    /**
     * 查询会员认证列表
     *
     * @param netUserPersonnel 会员认证
     * @return 会员认证
     */
    @Override
    public List<NetUserPersonnel> selectNetUserPersonnelList(NetUserPersonnel netUserPersonnel) {
        return netUserPersonnelMapper.selectNetUserPersonnelList(netUserPersonnel);
    }

    /**
     * 新增会员认证
     *
     * @param netUserPersonnel 会员认证
     * @return 结果
     */
    @Override
    public int insertNetUserPersonnel(NetUserPersonnel netUserPersonnel) {
        netUserPersonnel.setCreateTime(DateUtils.getNowDate());
        netUserPersonnel.setId(IdUtil.getSnowflakeNextId());
        return netUserPersonnelMapper.insertNetUserPersonnel(netUserPersonnel);
    }

    /**
     * 修改会员认证
     *
     * @param netUserPersonnel 会员认证
     * @return 结果
     */
    @Override
    public int updateNetUserPersonnel(NetUserPersonnel netUserPersonnel) {
        netUserPersonnel.setUpdateTime(DateUtils.getNowDate());
        return netUserPersonnelMapper.updateNetUserPersonnel(netUserPersonnel);
    }

    /**
     * 批量删除会员认证
     *
     * @param ids 需要删除的会员认证主键
     * @return 结果
     */
    @Override
    public int deleteNetUserPersonnelByIds(Long[] ids) {
        return netUserPersonnelMapper.deleteNetUserPersonnelByIds(ids);
    }

    /**
     * 删除会员认证信息
     *
     * @param id 会员认证主键
     * @return 结果
     */
    @Override
    public int deleteNetUserPersonnelById(Long id) {
        return netUserPersonnelMapper.deleteNetUserPersonnelById(id);
    }
}
